package com.itcam.freemarker.controller;

import com.itcam.freemarker.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author : Cammy.Wu
 * Description : 
 */

@Controller
public class DemoController {

    @GetMapping("/basic")
    public String test(Model model){
        // 1. 纯文本形式的参数
        model.addAttribute("name", "freemarker");
        // 2. 实体类相关参数
        Student student = new Student();
        student.setName("小明");
        student.setAge(20);
        model.addAttribute("student", student);
        return "01-basic";
    }
}
